<html>
<head><meta charset="utf-8"><title>slow-git · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html">slow-git</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="133873354"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133873354" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133873354">(Sep 13 2018 at 09:49)</a>:</h4>
<p>Not sure if this is worth putting in the rustc-guide somewhere, but I just found out that the reason <code>git</code> (and <code>tig</code>) were slow for me was because I had my global <code>.gitconfig</code> configured to download all the pull request references:</p>
<div class="codehilite"><pre><span></span><span class="k">[remote &quot;origin&quot;]</span>
  <span class="na">fetch</span> <span class="o">=</span> <span class="s">+refs/pull/*:refs/remotes/pull/*</span>
</pre></div>


<p>and that was massively slowing down git. Removing that setup and deleting all the remote-tracking local branches made everything better. :)</p>



<a name="133873438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133873438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133873438">(Sep 13 2018 at 09:50)</a>:</h4>
<p>(about ~55k local branches - 2x the number of pull requests ever)</p>



<a name="133884810"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133884810" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133884810">(Sep 13 2018 at 13:37)</a>:</h4>
<p><span class="user-mention" data-user-id="125311">@Dale Wijnand</span> interesting, anyway, that's not the default setting</p>



<a name="133884828"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133884828" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133884828">(Sep 13 2018 at 13:37)</a>:</h4>
<p>or was it generated by default to you with some specific tool?</p>



<a name="133884839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133884839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133884839">(Sep 13 2018 at 13:37)</a>:</h4>
<p>if you do git clone it does not generate that</p>



<a name="133885030"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133885030" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133885030">(Sep 13 2018 at 13:40)</a>:</h4>
<p>No indeed it's not a default setting and git cloning doesn't generate that.</p>
<p>GitHub documents these special references it uses in <a href="https://help.github.com/articles/checking-out-pull-requests-locally/" target="_blank" title="https://help.github.com/articles/checking-out-pull-requests-locally/">https://help.github.com/articles/checking-out-pull-requests-locally/</a>, so with a little know-how someone crafted that and passed it on.</p>



<a name="133891290"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133891290" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133891290">(Sep 13 2018 at 15:06)</a>:</h4>
<p><span class="emoji emoji-1f44d" title="+1">:+1:</span></p>



<a name="133952684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133952684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133952684">(Sep 14 2018 at 13:40)</a>:</h4>
<p><span class="user-mention" data-user-id="125311">@Dale Wijnand</span> I use this instead:</p>
<div class="codehilite"><pre><span></span>[alias]
        pr = &quot;!f() { git fetch -fu upstream refs/pull/$1/head:pr/$1; git checkout pr/$1; } ; f&quot;
</pre></div>


<p>And then just <code>git pr 1234</code></p>



<a name="133952799"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/slow-git/near/133952799" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Dale Wijnand <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/slow-git.html#133952799">(Sep 14 2018 at 13:41)</a>:</h4>
<p>I use <a href="https://hub.github.com/" target="_blank" title="https://hub.github.com/">https://hub.github.com/</a>, and then <code>git checkout https://github.com/rust-lang/rust/pull/1234</code>.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>